package com.chixing.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

@Component
public class MyInterceptor implements HandlerInterceptor {

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        // 在这里实现拦截器的前置处理逻辑
        System.out.println("MyInterceptor preHandle method executed");
        return true; // 返回true表示放行请求，返回false表示拦截请求
    }
}
